import Taro, { Component } from '@tarojs/taro'
import { View, Text,Image } from '@tarojs/components'
// import placeholderImg from '../../assets/images/common/white-bg.png'
import ImageCom from '../image-com/image-com'

import "./shop-item.scss"



class ShopItem extends Component {
  constructor(props) {
    super(props)
    this.state={
      date:new Date()
    }
  }

  componentWillMount() {}
  componentDidMount() {}

  componentWillUnmount() {
  }
  
  render() {

    return (
      <View className='shop-item' onClick={()=>{
        Taro.navigateTo({
          url: `/pages/webdetail/webdetail?url=${this.props.url}`
        })
      }}
      >
        <View className='shop-container'>
          <View className='shop-image'>
            <ImageCom
              style={{width: this.props.imgwidth+'px', height: this.props.imgwidth+'px'}}
              key={this.props.itemid}
              type='goods'
              src={this.props.imgsrc}
              mode='aspectFill'
            />
          </View>
          <View className='shop-title'>
            <View className='title-text'>{this.props.title}</View>
            <View>
              {this.props.price && <Text className='price-text'>￥{this.props.price }</Text>}
              {this.props.delPrice && <Text className='price-del'>￥{this.props.delPrice }</Text>}

            </View>
          </View>

        </View>
      </View>
    )
  }
}

export default ShopItem
